import flask
import os
import cv2
import numpy as np
from flask import Flask, request,json
import cv2
import request

app = Flask(__name__)


@app.route('/')
def hello_world():
    return flask.render_template('index.html')

@app.route("/video", methods=['get'])
def vedio_thread2():
    rtsp_path = request.args.to_dict().get('url')
    print("77：",rtsp_path)
    cap = cv2.VideoCapture(rtsp_path)
    ret, frame = cap.read()
    while ret:
        ret, frame = cap.read()
        cv2.imshow("frame", frame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    cv2.destroyAllWindows()
    cap.release()


if __name__ == '__main__':
    app.run()
